package per.hx.bs.config.shiro;

import org.apache.shiro.authz.UnauthorizedException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import per.hx.bs.base.domain.ReturnDTO;

/**
 * @author HuXing
 * @date 2018/4/28  11:53
 */
@RestControllerAdvice
public class ShiroAjaxException {

    @ExceptionHandler(UnauthorizedException.class)
    @ResponseBody
    public ReturnDTO ss() {
        return ReturnDTO.error("权限不足");
    }
}
